package avaliador;
import java_cup.runtime.*;
%%
%cup
%public
%class ALexico
%{
%}
%eofval{
    return new Symbol(sym.EOF);
%eofval}

%%

/*PALAVRAS RESERVADAS*/

"{" { return new Symbol(sym.AC); }
"}" { return new Symbol(sym.FC); }
"'" { return new Symbol(sym.ASP); }
"." { return new Symbol(sym.P); }
"," { return new Symbol(sym.V); }
"(" { return new Symbol(sym.A); }
")"  { return new Symbol(sym.F); }
";"  { return new Symbol(sym.PV); }
"=" { return new Symbol(sym.IGUAL); }
">" { return new Symbol(sym.MAIORQ); }
"<" { return new Symbol(sym.MENORQ); }
[Ss][Ee][Ll][Ee][Cc][Tt] { return new Symbol(sym.SELECT); }
[Ff][Rr][Oo][Mm] { return new Symbol(sym.FROM); }
[Ww][Hh][Ee][Rr][Ee] { return new Symbol(sym.WHERE); }
[Ii][Nn][Ss][Ee][Rr][Tt] { return new Symbol(sym.INSERT); }
[Vv][Aa][Ll][Uu][Ee][Ss] { return new Symbol(sym.VALUES); }
[Ii][Nn][Tt][Oo] { return new Symbol(sym.INTO); }
[Uu][Pp][Dd][Aa][Tt][Ee] { return new Symbol(sym.UPDATE); }
[Ss][Ee][Tt] { return new Symbol(sym.SET); }
[Dd][Ee][Ll][Ee][Tt][Ee] { return new Symbol(sym.DELETE); }
[Dd][Rr][Oo][Pp] { return new Symbol(sym.DROP); }
[Tt][Aa][Bb][Ll][Ee] { return new Symbol(sym.TABLE); }
[Cc][Rr][Ee][Aa][Tt][Ee] { return new Symbol(sym.CREATE); }
[Oo][Rr] { return new Symbol(sym.OR); }
[Aa][Nn][Dd] { return new Symbol(sym.AND); }
[Nn][Uu][Ll][Ll] { return new Symbol(sym.NULL); }
[Nn][Oo][Tt] { return new Symbol(sym.NOT); }

/*TIPOS*/
[Vv][Aa][Rr][Cc][Hh][Aa][Rr] { return new Symbol(sym.VARCHAR); }
[Ii][Nn][Tt][Ee][Gg][Ee][Rr] { return new Symbol(sym.INTEGER); }
[Cc][Hh][Aa][Rr] { return new Symbol(sym.CHAR); }

/*VARIAVEIS*/
[a-zA-Z_][0-9a-zA-Z]* { return new Symbol(sym.VARIAVEL, new String(yytext())); } 
[0-9]* { return new Symbol(sym.NUM, new Integer(yytext())); } 
[ \n\t\r\f] { /* ignora espaços e saltos de linha */ }